<div class="layui-col-md2" id="engindao">
    <div class="engindao_bac">
        <div class="engindao_div">
            <div class="engindao_title">预警类型</div>
            <div class="engindao_nav">
                <a id="engindao_left"><i class="layui-icon layui-icon-left"></i></a>
            </div>
        </div>
        <div id="engindao_content">
            <div class="cons"></div>
            <div id="loading_text"></div>
        </div>
    </div>
</div>
<div class="layui-col-md2 layui-hide" id="engindaomin">
    <div class="engindao_bg">
        <div class="col" id="engindao_right"><a><i class="layui-icon layui-icon-right"></i></a></div>
        <div class="engindao_title">预警类型</div>
    </div>
</div>
<script>
    var daoPage = 1, daoPagesize = 20, daoFinish = false;
    layui.use(["laytp",'tree','laypage','table','dropdown','form','soulTable'], function () {
        var tree = layui.tree,laypage = layui.laypage, table = layui.table, dropdown = layui.dropdown,
            form = layui.form, soulTable = layui.soulTable;

        getEnginDaoData();
        $("#engindao #engindao_left").click(function () {
            var cliHeight = document.getElementById('engindao').clientHeight;

            $("#engindao").addClass('layui-hide');
            $("#table-card #table_list").addClass('engindaomin_guan');

            document.getElementById('engindaomin').style.height = cliHeight+"px";
            $("#engindaomin").removeClass('layui-hide');
        });
        $("#engindaomin #engindao_right").click(function () {
            $("#engindao").removeClass('layui-hide');
            $("#table-card #table_list").removeClass('engindaomin_guan');
            $("#engindaomin").addClass('layui-hide');
        });



        function getEnginDaoData() {
            if(daoFinish){
                return false;
            }
            var engindao_name = $("#engindao_name").val() || '';
            facade.ajax({url: ask_warn_list, data: {type:dao_typess}}).done(function(res){
                if (res.code === 2000) {
                    if(res.data.current_page >= res.data.last_page){
                        enginDataFinish();
                    }

                    var str = '';
                    var daodata = res.data.data;
                    for (var key in daodata){
                        if(key == 0){
                            str += '<div class="lis engin_dao_dian" key="'+daodata[key].id+'">';
                            edit_data(daodata[key].id);
                        }else{
                            str += '<div class="lis" key="'+daodata[key].id+'">';
                        }
                        str += '<i class="layui-icon layui-icon-file"></i>';
                        str += '<span class="etext">'+daodata[key].title+'</span>';
                        str += '</div>';
                    }


                    $("#engindao_content .cons").append(str);
                    $("#engindao_content .cons .lis").click(function () {
                        $("#engindao  #engindao_all").removeClass('engin_dao_dian');
                        $("#engindao_content .cons .lis").removeClass('engin_dao_dian');
                        $(this).addClass('engin_dao_dian');

                        var thisEnginid = parseInt($(this).attr('key')) || 0;
                        edit_data(thisEnginid);
                    });

                    // var height = $('.laytp-container').height() - 70 + 'px';
                    // $('#engindao_content').css('cssText','max-height:'+height);
                }
            });
        }
    })





</script>